/*   
 * Copyright (c) 2010-2020 DMGIS Ltd. All Rights Reserved.   
 *   
 * This software is the confidential and proprietary information of   
 * DMGIS. You shall not disclose such Confidential Information   
 * and shall use it only in accordance with the terms of the agreements   
 * you entered into with DMGIS.   
 *   
 */
package com.dmgis.qxfw.dataservice.commonservice.dmgis_pg_srv.common.domain;

import java.io.InputStream;
import java.util.Properties;

/**
 * 
 * @author lc
 * @ClassName: DbConfig
 * @date 2018年9月10日 下午1:58:52 
 * @Description:全局配置
 */
public class DbConfig {
	static {
		Properties prop = new Properties();
		// 通过Object.class获取资源路径 path
		// 不以’/'开头时默认是从此类所在的包下取资源，以’/'开头则是从ClassPath根下获取。其只是通过path构造一个绝对路径，最终还是由ClassLoader获取资源。
		// InputStream in = Object.class.getResourceAsStream("/cas.properties");
		InputStream in = DbConfig.class.getClassLoader().getResourceAsStream("dbconfig.properties");
		try {
			prop.load(in);
			// 获取value
			pg_userName = prop.getProperty("pg_userName");
			pg_pwd = prop.getProperty("pg_pwd");
			pg_url = prop.getProperty("pg_url");
			DBNAME = prop.getProperty("DBNAME");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	//postgresql全局配置
	public static  String pg_userName;
	
	public static  String pg_pwd;
	
	public static  String pg_url;
	
	//dbname 配置数据库名称前缀，选择地区数据库。
	public static  String DBNAME;
}